//
//  JCPlanFootView.m
//  JiFengDaRen
//
//  Created by shouhan on 2018/4/2.
//  Copyright © 2018年 陈永发. All rights reserved.
//

#import "JCPlanFootView.h"
#import "UIView+FLExtension.h"
@interface JCPlanFootView()


@property (nonatomic, strong) UIButton * submitBtn;// 提交


@end

@implementation JCPlanFootView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initUI];
    }
    return self;
}


- (void)initUI{
    
    self.backgroundColor = KBASEBGCOLOR;
    
    self.submitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.submitBtn.frame = CGRectMake(0, __I6Height(70), __I6Width(326), __I6Height(42));
    self.submitBtn.centerX = self.centerX;
    self.submitBtn.tag = 102;
    [self.submitBtn.layer addSublayer:[UIColor setGradualChangingColor:self.submitBtn fromColor:@"58B0F7" toColor:@"178FEF"]];
    self.submitBtn.layer.masksToBounds = YES;
    self.submitBtn.layer.cornerRadius = 2;
    
    [self.submitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.submitBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [self.submitBtn setTitle:@"提交" forState:UIControlStateNormal];


    [self.submitBtn addTarget:self action:@selector(addAction:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.submitBtn];
    
}

- (void)layoutSubviews{
    
    [super layoutSubviews];
  
//    [self.submitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.centerX.equalTo(self);
//        make.width.mas_offset(__I6Width(326));
//        make.height.mas_offset(__I6Height(42));
//        make.top.equalTo(self).offset(50);
//    }];
    
}

- (void)addAction:(UIButton *)btn{
    
    NSDictionary * dic = [NSDictionary dictionaryWithObjectsAndKeys:@(btn.tag),@"tag", nil];
    
    [[NSNotificationCenter defaultCenter] postNotificationName:@"addSub" object:nil userInfo:dic];
}





@end
